package com.tom.user.controller;


import com.tom.common.model.ResponseResult;
import com.tom.user.service.GeetestVerifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author longjiang
 * @date 2020-03-26 11:27 上午
 * @description 极验验证码
 **/

@Slf4j
@RestController
@RequestMapping("gt")
public class GeetestController {
    private final GeetestVerifyService geetestVerifyService;

    @Autowired
    public GeetestController(GeetestVerifyService geetestVerifyService) {
        this.geetestVerifyService = geetestVerifyService;
    }

    /**
     * 极验初始化
     * @return
     */
    @GetMapping("/register")
    @ResponseBody
    protected ResponseResult register() {
        return geetestVerifyService.geetestRegister();
    }
}
